Complete Backtest





Kerry Back

Overview

  1. Get data
  2. Filter based on, e.g., size if desired
  3. Define industries and industry dummies if desired
  4. Transform features and ret in each cross-section
  5. Define pipeline

Loop

  1. For each date in a set of training dates,
  1. Define training data = past
  2. Fit GridSearchCV to pipeline on training data
  3. Use the trained model to make predictions for each month until the next training date

Compute returns

  1. Use predictions to define portfolios at the beginning of each month. Example: best 100 and worst 100, equally weighted
  2. Use actual (not transformed) stock returns to compute portfolio returns

Evaluate returns

  • Raw: Sharpe ratio, accumulation, drawdowns)
  • Compared to beta-adjusted market benchmark: alpha, information ratio
  • Compare to market and other factors (e.g., Fama-French: alpha, information ratio, attribution analysis